#ifndef APPEVENTDISPATCHER_H
#define APPEVENTDISPATCHER_H

#include <QAbstractNativeEventFilter>
#include "mainwindow.h"
#ifdef Q_OS_WIN
    #include <windows.h>
#endif

class AppEventDispathcer : public QAbstractNativeEventFilter
{
    MainWindow *mainWindow;
    bool isCtrlPressing;
    uint lastCtrlPressTime;

    void ProcessKeyDown(WPARAM wParam);
    void ProcessKeyUp(WPARAM wParam);
    void OnCtrlKeyDown();
    void OnCtrlKeyUp();
    void OnDoubleClickCtrlKey();

public:
    bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
    AppEventDispathcer(MainWindow *mainWindow);
};

#endif // APPEVENTDISPATCHER_H
